﻿///Name:LoginLogAccess类
///Author: 张仪
///Description: 
///Company:河南企汇网信息技术有限公司
///DateTime:2012-8-16 21:52:08


using System;
using System.Data;
using Model.Data;
using Model;
using DataAccess;
using BusinessLogic.BusinessRules;


namespace BusinessLogic.ClassFactory
{
	/// <summary>
	/// LoginLogFactory 的摘要说明。
	/// </summary>
	public class LoginLogFactory:BaseFactory
	{
		public LoginLogFactory() :base()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public LoginLogFactory(DBManager  l_DBManager):base(l_DBManager)
		{
		}
		public LoginLog NewInstance()
		{
			LoginLogAccess l_Access = new LoginLogAccess(m_Manager);
			LoginLog objLoginLog=new LoginLog(this.m_Manager,l_Access);			
			objLoginLog.NewDataSet();
			objLoginLog.SelectRow(0);
			return objLoginLog;
		}		

		public LoginLog CreatorBySql(string Sql)
		{
			LoginLogAccess l_Access = new LoginLogAccess(m_Manager);
			LoginLog objLoginLog=new LoginLog(this.m_Manager,l_Access);			
			DataSet l_ds=new LoginLogData();
			if(l_Access.QueryBySql(ref l_ds,Sql)<1)
			{
				return  null ;
			}
			objLoginLog.SetDataSet(l_ds);
			objLoginLog.SelectRow(0);
			return objLoginLog;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="intLoginLogID"></param>
		/// <returns></returns>
		public LoginLog Creator(int intLoginLogID)
		{
			LoginLogAccess l_Access = new LoginLogAccess(m_Manager);
			LoginLog objLoginLog=new LoginLog(this.m_Manager,l_Access);			
			DataSet l_ds=new LoginLogData();
			if(l_Access.QueryByID(ref l_ds,intLoginLogID)<1)
			{
				return null ;
			}
			objLoginLog.SetDataSet(l_ds);
			objLoginLog.SelectRow(0);
			return objLoginLog;
		}

		public LoginLog Creator()
		{
			LoginLogAccess l_Access = new LoginLogAccess(m_Manager);
			LoginLog objLoginLog=new LoginLog(this.m_Manager,l_Access);			
			DataSet l_ds=new LoginLogData();
			if(l_Access.QueryAll(ref l_ds)<1)
			{
				return null ;
				
			}
			objLoginLog.SetDataSet(l_ds);
			objLoginLog.SelectRow(0);
			return objLoginLog;
		}
		
	}
}
